#ifndef _MACHINE_H_
#define _MACHINE_H_
#include "define.h"
#include "icmp.h"
#include "netcapture.h"
#include <map>
#include <vector>

typedef struct _netcardinfo{
	char name[256];
	char desc[256];
	unsigned char mac[6];
	unsigned long ip;
	unsigned long mask;
}netcardinfo;

class machine
{
public:
	int ping(const char* ip, int bfs, int timeout, int& usedtime);
	int arpx(const char* carname,const char* ip,int timeout, unsigned char *mac);
	void getNetCardList(std::map<std::string,netcardinfo>& v );
	void getNewList(std::map<unsigned long,devstatus> & v);
	std::map<unsigned long,devstatus> m_devlist;
private:
#ifdef WIN32
	int getmacbydevname(char* pDevName , unsigned char *mac);
#else
	int getmacbyiface(const char *iface, int *ifindex, unsigned int *addr, unsigned char *mac);
#endif
	std::map<std::string, netcardinfo> m_NetCardList;
};
#endif
